package com.ychen.oms.config;

import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author chenyuliao
 * @version 1.0
 * @description
 * @date 2020/11/26 22:11
 */
@Configuration
@ComponentScan("com.ychen")
@EnableDubbo(scanBasePackages = "com.ychen")
@EnableWebMvc
@PropertySource("classpath:dubbo-consumer.properties")
public class ApplicationConfig implements WebMvcConfigurer {
    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
        System.out.println("-----configureMessageConverters-----");
        converters.add(new FastJsonHttpMessageConverter());
    }
}
